const HOSPITTAL_NAME = '江苏省中医院'

const header = {
  state: {
    title: HOSPITTAL_NAME,
    leftButton: true,
    rightButton: false,
    rightHtml: '注册',
    rightClick: function () {}
  },
  mutations: {
    UPDATE_TITLE (state, title) {
      if (!title) title = HOSPITTAL_NAME
      state.title = title
    },
    UPDATE_LEFTBUTTON (state, show) {
      state.leftButton = show
    },
    UPDATE_RIGHTBUTTON (state, payload) {
      state.rightButton = payload.show
      state.rightHtml = payload.html || '注册'
      state.rightClick = payload.fn || function () {}
    }
  }
}

export default header
